# Maintainer: fauxpark <fauxpark@gmail.com>

_realname=dfu-util
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=0.11
pkgrel=1
pkgdesc='Device firmware upgrade utilities (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=('GPL2')
groups=("${MINGW_PACKAGE_PREFIX}-eda")
url='https://dfu-util.sourceforge.io/'
depends=("${MINGW_PACKAGE_PREFIX}-libusb"
         "${MINGW_PACKAGE_PREFIX}-libwinpthread-git")
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc")
source=(
    "https://downloads.sourceforge.net/project/dfu-util/dfu-util-${pkgver}.tar.gz"
)
sha256sums=(
    'b4b53ba21a82ef7e3d4c47df2952adf5fa494f499b6b0b57c58c5d04ae8ff19e'
)

prepare() {
    cd ${srcdir}/${_realname}-${pkgver}
}

build() {
    cd ${srcdir}/${_realname}-${pkgver}
    ./configure --prefix=${MINGW_PREFIX}
}

package() {
    cd ${srcdir}/${_realname}-${pkgver}
    make DESTDIR="$pkgdir" install
}
